#ifndef LOGINUSER_H
#define LOGINUSER_H
#include <QJsonObject>
#include <QString>

class LoginUser
{
public:
    LoginUser() : id_(0) { }
    explicit LoginUser(const QJsonObject& jo);
    LoginUser(const QString& n, const QString& p);
    LoginUser(int i, const QString& n, const QString& p, const QString& a, const QString& r);

    int id() const { return id_; }
    const QString& name() const { return name_; }
    const QString& password() const { return password_; }
    const QString& accessToken() const { return access_token_; }
    const QString& refreshToken() const { return refresh_token_; }
    bool isValid() const { return !name_.isEmpty() && !password_.isEmpty(); }

    QJsonObject toJson() const;

private:
    int id_;
    QString name_;
    QString password_;
    QString access_token_;
    QString refresh_token_;
};

#endif // LOGINUSER_H
